<!DOCTYPE html>


















































<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <meta name="description" content="Javadoc API documentation for org.eclipse.sisu.inject." />

<!-- <link rel="shortcut icon" type="image/x-icon" href="../../../../favicon.ico" /> -->
<title>

  org.eclipse.sisu.wire Details


| org.eclipse.sisu.inject

</title>
<link href="../../../../../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../../../../../assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="../../../../../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="../../../../../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="../../../../../assets/doclava-developer-docs.js" type="text/javascript"></script>
<script src="../../../../../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
  setToRoot("../../../../", "../../../../../assets/");
</script>
<script src="../../../../../assets/doclava-developer-reference.js" type="text/javascript"></script>
<script src="../../../../../assets/navtree_data.js" type="text/javascript"></script>
<script src="../../../../../assets/customizations.js" type="text/javascript"></script>
<noscript>
  <style type="text/css">
    html,body{overflow:auto;}
    #body-content{position:relative; top:0;}
    #doc-content{overflow:visible;border-left:3px solid #666;}
    #side-nav{padding:0;}
    #side-nav .toggle-list ul {display:block;}
    #resize-packages-nav{border-bottom:3px solid #666;}
  </style>
</noscript>
</head>

<body class="">

<div id="header">
    <div id="headerLeft">
    
      <span id="masthead-title">org.eclipse.sisu.inject</span>
    
    </div>
    <div id="headerRight">
      
  <div id="search" >
      <div id="searchForm">
          <form accept-charset="utf-8" class="gsc-search-box" 
                onsubmit="return submit_search()">
            <table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
                <tr>
                  <td class="gsc-input">
                    <input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
                      title="search developer docs" name="q"
                      value="search developer docs"
                      onFocus="search_focus_changed(this, true)"
                      onBlur="search_focus_changed(this, false)"
                      onkeydown="return search_changed(event, true, '../../../../')"
                      onkeyup="return search_changed(event, false, '../../../../')" />
                  <div id="search_filtered_div" class="no-display">
                      <table id="search_filtered" cellspacing=0>
                      </table>
                  </div>
                  </td>
                  <td class="gsc-search-button">
                    <input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
                  </td>
                  <td class="gsc-clear-button">
                    <div title="clear results" class="gsc-clear-button">&nbsp;</div>
                  </td>
                </tr></tbody>
              </table>
          </form>
      </div><!-- searchForm -->
  </div><!-- search -->
      
    </div>
</div><!-- header -->


  <div class="g-section g-tpl-240" id="body-content">
    <div class="g-unit g-first side-nav-resizable" id="side-nav">
      <div id="swapper">
        <div id="nav-panels">
          <div id="resize-packages-nav">
            <div id="packages-nav">
              <div id="index-links">
                <a href="../../../../packages.html"  >Package Index</a> | 
                <a href="../../../../classes.html" >Class Index</a>
              </div>
              <ul>
                
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/package-summary.html">org.eclipse.sisu</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/bean/package-summary.html">org.eclipse.sisu.bean</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/inject/package-summary.html">org.eclipse.sisu.inject</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/launch/package-summary.html">org.eclipse.sisu.launch</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/osgi/package-summary.html">org.eclipse.sisu.osgi</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/eclipse/sisu/space/package-summary.html">org.eclipse.sisu.space</a></li>
    <li class="selected api apilevel-">
  <a href="../../../../org/eclipse/sisu/wire/package-summary.html">org.eclipse.sisu.wire</a></li>
    <li class="api apilevel-">
  <a href="../../../../org/sonatype/inject/package-summary.html">org.sonatype.inject</a></li>
              </ul><br/>
            </div> <!-- end packages -->
          </div> <!-- end resize-packages -->
          <div id="classes-nav">
            <ul>
              
    <li><h2>Interfaces</h2>
      <ul>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/ParameterKeys.html">ParameterKeys</a></li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/WireModule.Strategy.html">WireModule.Strategy</a></li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/Wiring.html">Wiring</a></li>
      </ul>
    </li>
              
    <li><h2>Classes</h2>
      <ul>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/AbstractTypeConverter.html">AbstractTypeConverter</a>&lt;T&gt;</li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/ChildWireModule.html">ChildWireModule</a></li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/EntryListAdapter.html">EntryListAdapter</a>&lt;V&gt;</li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/EntryMapAdapter.html">EntryMapAdapter</a>&lt;K,&nbsp;V&gt;</li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/EntrySetAdapter.html">EntrySetAdapter</a>&lt;V&gt;</li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/LocatorWiring.html">LocatorWiring</a></li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/MergedModule.html">MergedModule</a></li>
        <li class="api apilevel-"><a href="../../../../org/eclipse/sisu/wire/WireModule.html">WireModule</a></li>
      </ul>
    </li>
              
              
              
              
            </ul><br/>
          </div><!-- end classes -->
        </div><!-- end nav-panels -->
        <div id="nav-tree" style="display:none">
          <div id="index-links">
            <a href="../../../../packages.html"  >Package Index</a> | 
            <a href="../../../../classes.html" >Class Index</a>
          </div>
        </div><!-- end nav-tree -->
      </div><!-- end swapper -->
    </div> <!-- end side-nav -->
    <script>
      if (!isMobile) {
        <!-- $("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav"); -->
        chooseDefaultNav();
        if ($("#nav-tree").is(':visible')) {
          init_default_navtree("../../../../");
        } else {
          addLoadEvent(function() {
            scrollIntoView("packages-nav");
            scrollIntoView("classes-nav");
          });
        }
        $("#swapper").css({borderBottom:"2px solid #aaa"});
      } else {
        swapNav(); // tree view should be used on mobile
      }
    </script>



<div class="g-unit" id="doc-content">

<div id="api-info-block">
<div class="api-level">
  


  
  

</div>
</div>

<div id="jd-header">
  package
  <h1>org.eclipse.sisu.wire</b></h1>
  <div class="jd-nav">
      <a class="jd-navlink" href="package-summary.html">Classes</a> | Description
  </div>
</div><!-- end header -->

<div id="naMessage"></div>

<div id="jd-content" class="api apilevel-">
<div class="jd-descr">
<p>Customizable wiring of unresolved dependencies. Use this to share components across injectors, apply configuration, and form on-demand collections.
 <p><p>
 The <code><a href="../../../../org/eclipse/sisu/wire/WireModule.html">WireModule</a></code> should enclose all modules in your application:
 
 <pre>
 Guice.createInjector( new WireModule( bootModule, configModule, mainModule ) );</pre>
 
 Use the <code><a href="../../../../org/eclipse/sisu/wire/ChildWireModule.html">ChildWireModule</a></code> when you want to wire child injectors:
 <p><p>
 <pre>
 injector.createChildInjector( new ChildWireModule( serviceModule, subModule ) );</pre>
 <hr>
 The default wiring strategy is to use <code><a href="../../../../org/eclipse/sisu/wire/LocatorWiring.html">LocatorWiring</a></code> which can supply the following bindings via the <code><a href="../../../../org/eclipse/sisu/inject/BeanLocator.html">BeanLocator</a></code>:
 
 <h4>Instances</h4>
 <pre>
 &#064;Inject MyType bean
 
 &#064;Inject &#064;Named("hint") MyType namedBean
 
 &#064;Inject &#064;MyQualifier MyType qualifiedBean
 
 &#064;Inject Provider&lt;MyType&gt; beanProvider</pre>
 
 <h4>Configuration</h4>
 <pre>
 &#064;Inject &#064;Named("${my.property.name}") File file                      // supports basic type conversion
 
 &#064;Inject &#064;Named("${my.property.name:-http://example.org/}") URL url   // can give default in case property is not set
 
 &#064;Inject &#064;Named("${my.property.name:-development}") MyType bean       // can be used to pick specific &#064;Named beans
 
 &#064;Inject &#064;Named("my.property.name") int port                          // shorthand syntax</pre>
 <p><p>
 You can bind your configuration at runtime as follows:
 <pre>
 bind( <code><a href="../../../../org/eclipse/sisu/wire/ParameterKeys.html#PROPERTIES">ParameterKeys.PROPERTIES</a></code> ).toInstance( myConfiguration );      // multiple bindings are merged into one view</pre>
 
 <h4>Collections</h4>
 The following collections are both dynamic and thread-safe, elements may come and go as injectors are added or removed from the <code><a href="../../../../org/eclipse/sisu/inject/BeanLocator.html">BeanLocator</a></code>.
 <p>They are also <b>lazy</b>, meaning instances are created as you access elements of the collection; the elements are then re-used for the same collection.
 <p></p>
 <pre>
 &#064;Inject List&lt;MyType&gt; list
 
 &#064;Inject List&lt;Provider&lt;MyType&gt;&gt; providers
 
 &#064;Inject Iterable&lt;<code><a href="../../../../org/eclipse/sisu/BeanEntry.html">BeanEntry</a></code>&lt;MyQualifier, MyType&gt;&gt; entries             // gives access to additional metadata</pre>
 
 <pre>
 &#064;Inject Map&lt;String, MyType&gt; stringMap                                // strings are taken from @Named values
 
 &#064;Inject Map&lt;Named, MyType&gt; namedMap
 
 &#064;Inject Map&lt;MyQualifier, MyType&gt; qualifiedMap
 
 &#064;Inject Map&lt;String, Provider&lt;MyType&gt;&gt; providerMap</pre>
</p>
</div>

<div id="footer">
Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
</div> <!-- end footer -->

</div><!-- end jd-content -->
</div> <!-- end doc-content -->

</div> <!-- end body-content --> 

<script type="text/javascript">
init(); /* initialize doclava-developer-docs.js */
</script>

</body>
</html>
